package com.spzx.user.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.user.api.service.RemoteUserBrowseHistoryService;
import com.spzx.user.api.domain.UserBrowseHistory;
import org.springframework.cloud.openfeign.FallbackFactory;

public class RemoteUserBrowseHistoryFallbackFactory implements FallbackFactory<RemoteUserBrowseHistoryService> {
    @Override
    public RemoteUserBrowseHistoryService create(Throwable cause) {
        return new RemoteUserBrowseHistoryService() {
            @Override
            public R<?> saveUserBrowseHistory(UserBrowseHistory userBrowseHistory, String source) {
                return R.fail("远程调用用户微服务保存用户浏览器记录失败："+cause.getMessage());
            }
        };
    }
}

